<?php

namespace catchAdmin\api\service;

use catcher\CatchAuth;
use catcher\CatchResponse;
use catcher\Code;
use think\Exception;
use think\facade\Db;

class IndexService{

    public function checkTwoTradeType($check){
        $categoryA = [1, 4, 5];
        $categoryB = [2, 3];

        $hasCategoryA = false;
        $hasCategoryB = false;

        foreach ($check as $item) {
            if (in_array($item, $categoryA)) {
                $hasCategoryA = true;
            }
            if (in_array($item, $categoryB)) {
                $hasCategoryB = true;
            }
        }

        return $hasCategoryA && $hasCategoryB;
    }
}